package 刷题10月.每日一题0930;
import java.util.*;


public class Main5 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * Takes a string (separated by the first comma), returns a string ("True" or "False”).
     * @param raw string字符串 A comma separated string.
     * @return string字符串
     */
    public static String contains_substring (String raw) {
        // write code here

        String raws[]=find("123,526,584");
        if(raws.length==1)return "False";
        int max=0;
        int end=0;
        int array[][]=new int[raws[0].length()][raws[1].length()];
        for(int i=0;i<raws[0].length();i++){
            for(int j=0;j<raws[1].length();j++){
                if(raws[0].charAt(i)==raws[1].charAt(j)){
                    if(0==i||j==0){
                        array[i][j]=1;
                    }
                    else{
                        array[i][j]=1+array[i-1][j-1];
                    }
                }
                if(max<array[i][j]){
                    max=array[i][j];
                    end=i;
                }
            }
        }
        if(raws[0].substring(end-max+1,end+1).equals(raws[1])){
            return "True";
        }
        else
            return "False";



    }
    public static int findFirst(String s){
        return s.indexOf(",");
    }
    public static String[] find(String s){
        String[] ss=new String[2];
        ss[0]=s.substring(0,findFirst(s));
        ss[1]=s.substring(findFirst(s)+1,s.length());
        return ss;
    }
    public static void main(String[] args) {
        //System.out.println(contains_substring("88<#dv735792/0G,735"));
        //System.out.println(find("123,526,584"));
//        for (int i = 0; i < find("123,526,584").length; i++) {
//            System.out.println(find("123,526,584")[i]);
//        }
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        //System.out.println(reverse(s));
        String s=scan.nextLine();
        String arr[]=s.split(" ");
        System.out.println(arr.length);
        int arr1[]=new int[arr.length];
        for(int i=0;i<arr.length;i++){
            arr1[i]= Integer.parseInt(arr[i]);
        }
        Arrays.sort(arr1);
        System.out.println(arr1[arr1.length-1]);
    }
}
/*


public static String contains_substring (String raw) {
        // write code here

        String raws[]=raw.split(",");
        if(raws.length==1)return "False";
        int max=0;
        int end=0;
        int array[][]=new int[raws[0].length()][raws[1].length()];
        for(int i=0;i<raws[0].length();i++){
            for(int j=0;j<raws[1].length();j++){
                if(raws[0].charAt(i)==raws[1].charAt(j)){
                    if(0==i||j==0){
                        array[i][j]=1;
                    }
                    else{
                        array[i][j]=1+array[i-1][j-1];
                    }
                }
                if(max<array[i][j]){
                    max=array[i][j];
                    end=i;
                }
            }
        }
        if(raws[0].substring(end-max+1,end+1).equals(raws[1])){
            return "True";
        }
        else
            return "False";



    }
 */